import { ShaohuoContentService } from 'services/Api'

/* 排序相关（上移下移按钮）
-------------------------- */
export const bannerSortMixin = {
  computed: {
    // 排序移动参数
    alterBannerSortParam () {
      return {
        acc_id: this.acc_id,
        ids: this.selectIds,
        sort: this.sort
      }
    }
  },
  methods: {
    // 排序移动接口
    currentSortApi () {
      return ShaohuoContentService.alterBannerSort(this.alterBannerSortParam)
    }
  }
}

/* 状态相关（恢复禁用按钮）
-------------------------- */
export const bannerStatusMixin = {
  computed: {
    // 禁用,解禁参数
    alterBannerStatusParam () {
      return {
        acc_id: this.acc_id,
        ids: this.selectIds,
        status: this.status,
        is_del: ''
      }
    }
  },
  methods: {
    // 改变状态接口
    currentStatusApi () {
      return ShaohuoContentService.alterBannerStatus(this.alterBannerStatusParam)
    }
  }
}

/* 删除相关
-------------------------- */
export const bannerDeleteMixin = {
  computed: {
    // 删除参数
    deleteBannerStatusParam () {
      return {
        acc_id: this.acc_id,
        ids: this.selectIds,
        status: '',
        is_del: 1
      }
    }
  },
  methods: {
    // 删除接口
    currentDeleteApi () {
      return ShaohuoContentService.alterBannerStatus(this.deleteBannerStatusParam)
    }
  }
}

/* 编辑相关
-------------------------- */
export const bannerEditMixin = {
  computed: {
    // 详情查询参数
    bannerDetailParam () {
      return {
        acc_id: this.acc_id,
        id: this.editId
      }
    }
  },
  methods: {
    // 详情查询接口
    currentGetDataApi () {
      return ShaohuoContentService.bannerDetail(this.bannerDetailParam)
    }
  }
}
